package elderberryni2.abstracts;

/**
 * And Interface to introduce a Behaviour that allows to add timestamps 
 * to any given Class/Datacontainer.
 *
 * @param <N> extends Number
 * @author warringer
 * @version 1.0
 */
public abstract class BaseTimestampable<N extends Number> {
    
    private N timeStamp;
    
    /**
     * Returns the given Timestamp of the Class/Datacontainer
     * 
     * @return  timestamp
     */
    public N getTimestamp() {
        return timeStamp;
    };
    
    /**
     * returns the difference between the timestamp of the current Class/
     * Datacontainer and another timestamp
     * 
     * @param   timestamp
     * @return  difference between timestamps
     */
    public abstract N getTimestampDifference(N timestamp);
    
    /**
     * sets th timestamp of the Class/Datacontainer
     * 
     * @param timestamp 
     */
    public void setTimestamp(N timestamp)
    {
        this.timeStamp = timestamp;
    }
}
